//**************************************
//            I N C L U D E
//**************************************

#include <stdio.h>
#include <string.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "env_dev.h" // spi controller
//#include "spi.h"  // spi controller
//#include "uart.h"  // uart controller
#include "clock.h"
#include "timer.h"  //test 
#include "io_modul.h"  //test
#include "can.h"
//#include "clock.h"
//#include "taster.h"
//#include "rollo.h"
//#include "menu.h"
//#include "main.h"

//**************************************
//            M A I N
//**************************************


#define NOTHING 0x00
#define RECHTS 0x01
#define LINKS 0x02
#define BUTTON 0x03


#define FIRST_IO EG_KITCH_RIGHT_UP  // aufpassen FIRST_IO muss kleiner sein als LAST_IO
#define LAST_IO EG_STAIR_DOWN       // ausserdem muessen die IOs auch zusammenhaengen als BLOCK


void main_job(void) {

can_job();
io_job();

return;
}



int main(void)
{
//uint8_t data[8]={TYPE_ROLLO_MULTI	,0x13,0x15,0x00,0x00,0x00,0x00,0xFF};;

init_io_modul();  //startet IO Verwaltung
ioinit();


//can_to_io(data);

can_init();
init_clock();
sei();  // irq aktivieren

//uint8_t data[8];
//while(1) {can_message(data);}
for( ;; ) main_job();
return 0;
}

